﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms; 
using CourseArraging.Common;
using Stone.Library.Common;
using System.ServiceModel;

namespace CourseArraging.UControl
{
    public partial class UCCombo_base : UserControl
    {
        #region 参数
        protected BasicService.BasicServiceClient basicProxy;
        BasicHttpBinding bind = new BasicHttpBinding();
        EndpointAddress metaAddress = new EndpointAddress(GlobalVar.basicserviceAddress);
        protected List<MyListItem> listItems = new List<MyListItem>();
        protected string[][] tmpdata;
        #endregion 

        #region 构造器
        public UCCombo_base()
        {
            InitializeComponent();
            this.Load += new EventHandler(UCCombo_base_Load);
            basicProxy = new BasicService.BasicServiceClient(bind, metaAddress);
        }

        void UCCombo_base_Load(object sender, EventArgs e)
        {
            showData();
        }
        #endregion

        #region 方法

        private void showData()
        {
            setData();
            this.comboBox1.DataSource = listItems;
            this.comboBox1.DisplayMember = "TextField";
            this.comboBox1.ValueMember = "ValueField";
        }
        #endregion

        #region 抽象方法
        //将数据存储到listItems中
        protected virtual void setData()
        {
        }
        #endregion
    }
}
